package com.example.recruitment_website.service.Impl;


import com.example.recruitment_website.domain.Article;
import com.example.recruitment_website.dto.HeadlinesBriefDto;
import com.example.recruitment_website.dto.HeadlinesBriefRepository;
import com.example.recruitment_website.repository.ArticleRepository;
import com.example.recruitment_website.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ArticleImpl implements ArticleService {
    @Autowired
    ArticleRepository articleRepository;
    @Autowired
    HeadlinesBriefRepository headlinesBriefRepository;
    @Override
    public List<Article> findAll() {
        return articleRepository.findAll();
    }

    @Override
    public List<HeadlinesBriefDto> findHeadlinesList() {
        return headlinesBriefRepository.findHeadlinesList();
    }

    @Override
    public List<HeadlinesBriefDto> findListByType(Integer type) {
        return headlinesBriefRepository.findListByType(type);
    }

    @Override
    public List<HeadlinesBriefDto> searchArticleByKey(String key) {
        List<HeadlinesBriefDto> list =  headlinesBriefRepository.searchArticleByKey(key);
        return list;
    }

}
